import Vue from 'vue';
import Vuex from 'vuex';
import app from './modules/app';
import resource from './modules/resource';
import getters from './getters';
import createPersistedState from 'vuex-persistedstate';
Vue.use(Vuex);
const PERSIST_PATHS = ['app.cityDetail']; // 注意
const store = new Vuex.Store({
  namespaced: true,
  plugins: [
    createPersistedState({
      storage: window.sessionStorage, // 注意
      paths:PERSIST_PATHS // 注意
    })
  ],
  modules: {
    app,
    resource
  },
  getters
});

export default store;
